package com.zemo.base.service.sys.impl;

import com.zemo.base.dao.sys.UserDao;
import com.zemo.base.domain.entity.sys.UserEntity;
import com.zemo.base.service.sys.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @ClassName: UserServiceImpl
 * @author: SuperZemo
 * @email: zemochen@gmail.com
 * @Date 07/04/2018 22:40
 * @Description
 */
@Service
public class UserServiceImpl implements UserService {

    @Resource
    private UserDao userDao;

    @Override
    public UserEntity save(UserEntity entity) {
        userDao.insert(entity);
        return entity;
    }

    @Override
    public UserEntity update(UserEntity entity) {
        userDao.update(entity);
        return entity;
    }

    @Override
    public UserEntity getUserByToken(String token) {
        return userDao.getByToken(token);
    }

}
